{% extends "base.html" %}

{% block content %}
<h1>{{ query.title }}</h1>
<em>{{ query.description }}</em>
<hr>
<form action="." method="POST">{% csrf_token %}
<input type="submit" value="Run Query">
</form>
<hr>
{% if headers %}
<table class="flatquery_results" border="1">
<tr>
{% for header in headers %}
  <th>{{ header }}</th>
{% endfor %}
</tr>
{% for row in rows %}
<tr>
  {% for col in row %}
  <td>{{ col }}</td>
  {% endfor %}
</tr>
{% empty %}
<tr>
  <td>Query returned no results.</td>
</tr>
{% endfor %}
</table>
{% endif %}
{% endblock content %}
